﻿@model Management.Areas.Control.Models.AssignedRoleViewModel

@using (Html.BeginForm("EditJson", "Admin"))
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
       @*<div class="form-group">
            @Html.LabelFor(model => model.RoleID, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.RoleID, (IEnumerable<SelectListItem>)ViewBag.Roles, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.RoleID, "", new { @class = "text-danger" })
            </div>
        </div>*@
        
        <div class="form-group">
            <div class="col-md-10">
                @{
                    int cnt = 0;
                    List<Management.Areas.Control.Models.AssignedRoleViewModel> roles = ViewBag.Roles;
                    <input type="hidden" name="id" value="@roles[0].AdminID"/>
                    foreach (var role in roles)
                    {
                        if (cnt++ % 4 == 0)
                        {
                            <br />
                        }
                        <input type="checkbox" name="selectedRoles" value="@role.RoleID" @(Html.Raw(role.Assigned ? " checked='checked' " : "")) />
                                    @role.Name
                    }
                }
            </div>
        </div>

    </div>
}
@Scripts.Render("~/bundles/jqueryval")
